import ACTIONKEY from '../key'

const initialState = {
  isLogin: false,
  phone: '',
}

export default (state = initialState, action) => {
  switch (action.type) {
    case ACTIONKEY.USER_LOGIN:
      return {
        ...state,
        isLogin: true,
        phone: action.phone,
      }
    case ACTIONKEY.USER_LOGOUT:
      return initialState
    default:
      // console.log('is login state=', state)
      return state
  }
}
